<template>
  <div class="login">
      <el-form name="didi"
      style="width:400px;margin:auto;">
        <header class="header" >登录</header>
          <el-input placeholder="姓名" style="margin-top:30px;" v-model="form.name"></el-input>
          <el-input placeholder="年龄" style="margin-top:30px;" v-model="form.age"></el-input>
          <el-input placeholder="性别" style="margin-top:30px;" v-model="form.gender"></el-input>
          <el-input placeholder="大学" style="margin-top:30px;" v-model="form.school"></el-input>
          <button type="button" style="width:100%;height:40px;margin-top:40px;background-color:pink;
     border-radius:10px;border: none;color:#fff;font-size:20px;" @click="submit">登录</button>
      </el-form>
  </div>
</template>

<script>
export default {
  name: "Home",
  data() {
    return {
      form: {
        name:"",
        age: "",
        gender: "",
        school: "",
      },
    };
  },
  methods: {
    submit(){
      console.log('this.form',this.form)
      this.$store.commit('setUserState', this.form)
      setTimeout( () => {
        this.$router.push({path:'/about'})
      },1000)
      
      //return
    }
  }
}
</script>
<style lang="scss" scoped>
.login{
  width: 1000px;
  height: 700px;
  border-radius: 20px;
  font-size: 20px;
  box-shadow: 0px 0px 2px 1px rgb(0 0 0 / 20%);
   margin: auto;
   margin-top: 5%;
}
.header {
    height: 90px;
    line-height: 90px;
    font-size:30px;
    text-align: center;
    }
    a{
      text-decoration: none;
      color:black;
    }
</style>
